package com.arofoxmsn.model.identifiedObject;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.CascadeType;
import javax.persistence.Embeddable;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;

import com.arofoxmsn.model.User;

@Embeddable
public class FavoriteObject implements Serializable{
	
	private static final long serialVersionUID = 1L;

	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private MyObject object;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private User owner;
	
	private Calendar createdAt;
	
	public FavoriteObject(){
		super();
	}
	
	public FavoriteObject(MyObject object, User owner) {
		super();
		this.object = object;
		this.owner = owner;
	}
	
	public MyObject getObject() {return object;}
	public void setObject(MyObject object) {this.object = object;}
	
	public User getOwner() {return owner;}
	public void setOwner(User owner) {this.owner = owner;}
	
	public Calendar getCreatedAt() {return createdAt;}
	public void setCreatedAt(Calendar createdAt) {this.createdAt = createdAt;}
	
}
